var obj = {
    name:"小明",
    age: 18,
}
Object.defineProperty(obj,'name',{
    set(newValue){
        console.log('调用了set方法',newValue);
        name = newValue;
    },
    get(){
        console.log('调用了get方法');
        return name;
    }
})

Object.defineProperty(obj, "age", {
    configurable:true,
    enumerable:true
})


obj.name = 123;
console.log(obj.name);
delete  obj.age
console.log(obj.age);